package com.ht.aems.fesservice.job;

import com.ht.aems.fesservice.RemoteFesServer;
import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * Created by IntelliJ IDEA.
 *
 * @author Dong Shufeng
 *         Date: 2007-4-15
 *         Time: 9:30:10
 */
public class RefreshCommUnitsJob implements Job {
    private static Logger log = Logger.getLogger(RefreshCommUnitsJob.class);
    private static boolean isRunning = false;

    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        if (isRunning) return;
        try {
            isRunning = true;
            RemoteFesServer.getInstance().refreshServer();
        } catch (Exception e) {
            log.warn(e);
            e.printStackTrace();
        } finally {
            isRunning = false;
        }
    }
}
